package com.drivers.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVo {
    private Integer code;
    private String message;
    private Object data;

    public ResultVo(Integer code, String message){
        this.code = code;
        this.message = message;
    }


    public static ResultVo ok(Object data){
        return new ResultVo(1,"SUCCESS",data);
    }
    public static ResultVo ok(){
        return new ResultVo(1,"SUCCESS");
    }

    public static ResultVo error(String message){
        return new ResultVo(0,message);
    }
    public static ResultVo error(String message,Object data){
        return new ResultVo(0,message,data);
    }
    public static ResultVo error(){
        return new ResultVo(0,"ERROR");
    }
}
